package com.sc.VenusQueryBeta.model.account.cunka;

import com.hengjun.kingstar.sdk.base.BaseModel;
import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.account.AccountApi;
import com.sc.VenusQueryBeta.contract.account.cunka.CunKa01Contract;
import com.sc.VenusQueryBeta.model.bean.account.CurrencyListBean;
import com.sc.VenusQueryBeta.model.bean.account.cunka.CunKaList1;

import io.reactivex.Observable;

/**
 * Created by Administrator on 18/10/2018.
 *
 */

public class CunKa01Model extends BaseModel implements CunKa01Contract.ICunKa01Model {

    @Override
    public Observable<CunKaList1> getCunKa01(String serverAddress, String projectName, int serverPort, int clientindex, int start, int limit, String clientAppmsgnum,String currencynameCN) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").
                cunka01(clientindex,start,limit,clientAppmsgnum, currencynameCN).compose(RxHelper.<CunKaList1>rxSchedulerHelper());
    }

    @Override
    public Observable<CurrencyListBean> queryAllCurrencyList(String serverAddress, String projectName, int serverPort) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").queryCurrencyList().compose(RxHelper.<CurrencyListBean>rxSchedulerHelper());

    }

    public static CunKa01Model newInstance() {
        return new CunKa01Model();
    }
}
